<template>
  <el-pagination
    class="js_common_fenyeqi"
    :current-page="page.pageNum"
    :page-size="page.pageSize"
    :pager-count="5"
    :append-to-body="false"
    popper-class="js_common_fenyeqi_popper"
    layout="prev, pager, next, sizes, jumper"
    :total="page.total"
    @current-change="handleCurrentChange"
    @prev-click="prevClick"
    @next-click="nextClick"
    @size-change="handleSizeChange"
  >
  </el-pagination>
</template>
<script>
export default {
  name: "",
  components: {},
  props: {
    page: {
      type: Object,
      default: () => {
        return {
          pageNum: 1,
          pageSize: 10,
          total: 0,
        };
      },
    },
  },
  data() {
    return {};
  },
  methods: {
    handleCurrentChange(val) {
      this.page.pageNum = val;
      this.$emit("pageChange", this.page);
    },
    prevClick() {
      this.page.pageNum = this.page.pageNum - 1;
      this.$emit("pageChange", this.page);
    },
    nextClick() {
      this.page.pageNum = this.page.pageNum + 1;
      this.$emit("pageChange", this.page);
    },
    handleSizeChange(val) {
      this.page.pageSize = val;
      this.$emit("pageChange", this.page);
    },
  },
  created() {},
  mounted() {},
};
</script>
<style lang="scss" scoped>
.container {
  width: 100%;
  height: 100%;
}
</style>
